//收藏歌单

// const express = require('express');
// const app = express();
const Http = require('../util/request');

module.exports = (query, request) => {
    // console.log(query)
    query.query.t = (query.query.t == 1 ? 'subscribe' : 'unsubscribe')
    const data = {
        id: query.query.id
    };
    Http(
        'POST', `https://music.163.com/weapi/playlist/${query.query.t}`, data,
        {crypto: 'weapi', cookie: query.cookies, proxy: query.query.proxy}
    ).then(res => {
        request.json(res)
    }).catch( err => {
        request.json(err)
    })
};
